@extends('layouts.default') 
@section('main')
    <link rel="stylesheet" href="{{URL::asset('js/')}}/kindeditor-4.1.7/themes/default/default.css" />
    <link rel="stylesheet" href="{{URL::asset('js/')}}/kindeditor-4.1.7/plugins/code/prettify.css" />
    <script src="{{URL::asset('js/')}}/kindeditor-4.1.7/kindeditor.js" type="text/javascript"></script> 
    <script charset="utf-8" src="{{URL::asset('js/')}}/kindeditor-4.1.7/lang/zh_CN.js"></script> 
    <script charset="utf-8" src="{{URL::asset('js/')}}/kindeditor-4.1.7/plugins/code/prettify.js"></script>
    <script type="text/javascript" src="{{URL::asset('js/')}}/ajaxfileupload.js"></script>
    <script type="text/javascript" src="{{URL::asset('js/')}}/common.js"></script>
    <script src="{{URL::asset('js/My97DatePicker/')}}/WdatePicker.js"></script> 
    <script>
    KindEditor.ready(function(K) {

            var editor1 = K.create('#intro,#education,#worklife,#businesslife', {
                uploadJson: "{{url('kindedit/upload')}}",
                fileManagerJson: "{{url('kindedit/manager')}}",
                allowFileManager: true,
                afterBlur: function() {
                    this.sync();
                },
                items: ['source', '|', 'undo', 'redo', '|', 'cut', 'copy', 'paste', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall', 'image', '/', 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'table', 'hr', 'emoticons', 'pagebreak', 'anchor', 'link', 'unlink', '|']
                });
            
    });
    </script>
    <style type="text/css">
        .control-group .control-label span{
            color:red;
            font-size:16px;
            font-weight:bold;
            margin-right:10px;
        }
    </style>
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i
                            class="icon-home"></i> 首页</a> <a href="{{url('project/index')}}" class="tip-bottom">项目管理</a><a href="{{url('project/info?id='.$project_id)}}" class="tip-bottom">项目信息</a><a href="{{url('project/member?id='.$project_id)}}" class="tip-bottom">成员管理</a> <a href="#" class="current">新增成员</a>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span7" style="width:80%;">
                    <div class="widget-box">
                        <div class="widget-title">
						<span class="icon"> <i class="icon-align-justify"></i>
						</span>
                            <h5>新增项目成员</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <form  action="{{url('project/memberinsert')}}" method="post" class="form-horizontal" id="projectForm" >
                                <input type="hidden" name="project_id" value="{{ $project_id }}">
                        
                                <div class="control-group">
                                    <label class="control-label"><span>*</span>成员名 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="name" value=""   />
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"><span>*</span>成员头像 :</label>
                                    <div class="controls">
                                        <input type="hidden" class="span11" name="photo"
                                               placeholder="点击右边小图标上传列表页缩略图" />
                                        <img src="" width="120px" name="photo" height="120px"/>

                                        <a href="javascript:void(0);" id="uploadPhotoBtn"   onclick="javascript:openBrowse('uploadPhotoBtn','uploadPhoto');">点击上传(图片大小不小于h:195像素×w:195像素)</a>
                                        <input type="file" id="uploadPhoto" style="display:none" name="myfile" size="10" onchange="fileUpload('uploadPhoto','photo')"/>
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label"><span>*</span>成员身份 :</label>
                                    <div class="controls">
                                        <select name="is_leader" id="is_leader">
                                            <option value="0" checked="checked">普通成员</option>
                                            <option value="1">领导成员</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">职位 :</label>
                                    <div class="controls">
                                        <input type="text" class="span11" name="position" value=""   />
                                    </div>
                                </div>
                                
                                <div class="control-group">
                                    <label class="control-label">人物介绍 :</label>
                                    <div class="controls">
                                        <textarea id="intro" name="intro" cols="150" rows="6" style="width:650px;"></textarea>
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">教育背景 :</label>
                                    <div class="controls">
                                        <textarea id="education" name="education" cols="150" rows="6" style="width:650px;"></textarea>
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">工作经历 :</label>
                                    <div class="controls">
                                        <textarea id="worklife" name="worklife" cols="150" rows="6" style="width:650px;"></textarea>
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">创业经历 :</label>
                                    <div class="controls">
                                        <textarea id="businesslife" name="businesslife" cols="150" rows="6" style="width:650px;"></textarea>
                                    </div>
                                </div>
                                
                                <div class="control-group">
                                    <label class="control-label">是否审核通过 :</label>
                                    <div class="controls">
                                        <label> <input type="radio" name="status" value="1" checked="checked" /> 是
                                        </label> <label> <input type="radio" name="status" value="0" /> 否
                                        </label>
                                    </div>
                                </div>
                               
                                {{--@endif--}}
                                <div class="form-actions">
                                    <button type="button" class="btn btn-success" id="doSave">确认新增</button>
                                </div>
                            </form>
                        </div>
                        @include('message.flash')
                        @include('errors.list')
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        
        $("#doSave").click(function(){
            $(this).attr('disabled','disabled');

            ajaxRequest($('#projectForm').serializeArray(),$('#projectForm').attr('action'),function(data){
                if(data.status){
                    alert(data.message);
                    window.location.href = data.forwardUrl;
                }else{
                    $("#doSave").removeAttr('disabled');

                    alert(data.message);
                }
            });
        });

       /* $("#city").change(function() {
            $("#zone").empty();
            $.post("{{url('zone/children')}}", {
                id: $(this).val()
            }, function(data) {
                if (data.status) {
                    var html = '<option value="0">城市</option>';
                    $.each(data.message, function(i, n) {
                        html += "<option value='"+n.id+"'>"+n.name+"</option>";
                    });
                    $("#zone").html(html);
                }
            }, 'json');
        });   */

    </script>
@stop
